package com.javasm.gm.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.javasm.gm.Gift;
import com.javasm.gm.GiftService;
import com.javasm.gm.dao.GiftDao;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GiftServiceImpl extends ServiceImpl<GiftDao,Gift> implements GiftService {

    @Override
    public List<Gift> listGift(Gift g) {
        return super.baseMapper.listGift(g);
    }

    @Override
    public boolean updateGiftStock(Integer giftId, Integer count) {
        int r = baseMapper.updateGiftStock(giftId,count);
        return r==1;
    }

    @Override
    public Integer getGiftIdByGoodsId(Integer goodsId) {
        return baseMapper.getGiftIdByGoodsId(goodsId);
    }
}
